import java.util.Scanner;   //2017.3     question 1

public class Cake {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n,k,num=0,sum=0;
        n=sc.nextInt();
        int array[]=new int[n];
        k=sc.nextInt();
        for (int i = 0; i < n; i++) {
            array[i]=sc.nextInt();
        }
        while (n>0){
            sum=sum+array[n-1];
            if (sum>=k) {
                num++;
                sum=0;
            }
            n--;
        }
        if (sum!=0)
        num++;
        System.out.println(num);
    }
}
